package com.wowoai.removewatermark.controller;

import com.wowoai.common.response.ResponseVO;
import com.wowoai.removewatermark.service.RemoveWatermarkServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 去除水印控制器
 */
@RestController
@RequestMapping("/removeWatermark")
public class RemoveWatermarkController {

    @Autowired
    private RemoveWatermarkServiceI removeWatermarkService;

    @GetMapping("/detect")
    public ResponseVO<Map<String, Object>> removeWatermark(@RequestParam String url) {
        Map<String, Object> resultMap = removeWatermarkService.detect(url);
        return ResponseVO.success(resultMap);
    }
}
